<template>
  <div>首页  
<a href="/login">登录</a>
<el-table 
    :data="speakList.data"
    border
    style="width: 100%"
    center>
    <el-table-column
      fixed
      prop="speakId"
      label="编号"
      width="150"
     >
    </el-table-column>
    <el-table-column
      fixed
      prop="speakMassage"
      label="评论"
      width="150">
    </el-table-column>
    <el-table-column
      fixed
      prop="tiktokNum"
      label="点赞数"
      width="150">
   
    </el-table-column>
    <el-table-column
    width="50"
     label="是否点赞" >
    <template  slot-scope="scope"> 
        <i class="el-icon-success" v-if="scope.row.users>0"></i> 
     </template>         
      </el-table-column> 
    <el-table-column >
    <template  slot-scope="scope"> 
        <input type="button" @click="find(scope.row)" value="点赞" v-if="loginUser.id>0">   
           
     </template>         
      </el-table-column> 

    <!-- <el-table-column 
    prop="face" 
    label="图片" >
    <template   slot-scope="scope">           
         <img :src="'/project/upload/'+scope.row.face"  width="200" height="50" />
     </template>         
      </el-table-column>  -->
  </el-table>
      
  </div>

</template>

<script>
 import{mapState,mapMutations,mapActions}from "vuex"
export default {
    computed:{
        ...mapState(["showLogin","speakList","loginUser",])
       
    },


    methods:{
          ...mapMutations(["setShowLogin","setParam","setUser"],),
          ...mapActions(["getUsers","findAll"]),
        




find(n){
    alert(JSON.stringify(n))

}

    },
    created(){
        this.findAll();
       this.loginUser.id=this.$cookies.get('token');
       alert(this.$cookies.get('theretoken'))
    }

}
</script>

<style>

</style>